define(['app'], function(app) {
    'use strict';

    //实例化方法
    var factory = function (Http) {
		function get_data_af_back(result){
			if(HTTP_ISLOGIC){
				result = '{"success":true,"msg":"","result":{"order_id":1},"session":"7311da98bd0f18eb15a96bcb263f4153"}';
				return JSON.parse(result);
			}else
			return result;
		}
		
        //返回信息
        return {
            af_back:function(order_id,type,reason,money,instructions,phone,callback){
            	var updateParams = new Object();
            	updateParams.order_id = order_id;
            	updateParams.type = type;
            	updateParams.reason = reason;
            	updateParams.money = money;
            	updateParams.instructions = instructions;
            	updateParams.phone = phone;
            	updateParams = JSON.stringify(updateParams);
            	Http.post({
            		method:'order.return.apply',
            		updateParams:updateParams
            	},function(result){
            		if(callback)
            		callback(get_data_af_back(result));
            	},function(e){
            		
            	},function(){
            		
            	})
            }
            
            
        };
    }

    factory.$inject = ['Http'];
    return app.registerService("Afback", factory);
});